package com.example.design.ticket.builder;

import com.example.design.ticket.product.CompanyTicket;

// 建造者企业票据生成器
public class CompanyTicketBuilder extends TicketBuilder<CompanyTicket> implements Cloneable{

    private CompanyTicket companyTicket = new CompanyTicket();

    //对于CompanyTicket，我们需要setCommonInfo
    @Override
    public void setCommonInfo(String title, String product, String content) {
        companyTicket.setTitle(title);
        companyTicket.setProduct(product);
        companyTicket.setContent(content);
    }

    //对于CompanyTicket，我们需要setBankInfo
    @Override
    public void setBankInfo(String bankInfo) {
        companyTicket.setBankInfo(bankInfo);
    }

    //对于CompanyTicket，我们需要setTaxId
    @Override
    public void setTaxId(String taxId) {
        companyTicket.setTaxId(taxId);
    }

    //返回企业票据
    @Override
    public CompanyTicket buildTicket() {
        return companyTicket;
    }
}
